package cn.iocoder.yudao.module.api.shop.revenue.dto;

import cn.iocoder.yudao.framework.validation.Percent;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 营收记录 Request DTO
 *
 * @author 山野羡民
 */
@Data
@NoArgsConstructor
public class RevenueSaveDTO {

    @Schema(description = "交易单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "交易单号不能为空")
    private String tradeNo;

    @Schema(description = "交易订单快照")
    private String orderSnapshot;

    @Schema(description = "订单金额，单位为分", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订单金额不能为空")
    private Integer orderPrice;

    @Schema(description = "实付金额，单位为分", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "实付金额不能为空")
    private Integer payPrice;

    @Schema(description = "结算比例", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "结算比例不能为空")
    @Percent
    private Double settlementPercent;

    @Schema(description = "来源用户编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "来源用户编号不能为空")
    private Long sourceUserId;

    @Schema(description = "佣金冻结天数，根据退款退货期限进行灵活设置，如7天", requiredMode = Schema.RequiredMode.REQUIRED)
    @PositiveOrZero
    private int frozenDays;

    @Schema(description = "备注")
    private String note;

}
